﻿<!DOCTYPE html>
<html lang="zn" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="utf-8">
        <title> 新闻详细信息 </title>
        <meta name="renderer" content="webkit">
		<base th:href="@{/}"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="static/css/x-admin.css" media="all">
        <link rel="stylesheet" href="static/css/backstage.css" media="all">
        <script src="static/js/jquery.min.js"></script>
	    <script>
	     $(function(){
	    	//获取news传参(新闻id)    
	        var searchURL = window.location.search;
	        searchURL = searchURL.substring(1, searchURL.length);
	        var newId = searchURL.split("&")[0].split("=")[1];
	        alert(newId)
	        $.ajax({
	            type:"GET",
	            url:"news/findNewsById?id="+newId,
	            dataType:"json",
	            success:function(data){   
	            	json_data=eval(data);
	            	console.log(json_data);
	 
	              $("#title p").append(json_data.t.newstitle);
	              category="";
	              if(json_data.t.marketId==1){
	            	  category="国内市场动态 ";
	              }else if(json_data.t.marketId==2){
	            	  category="国际市场动态";
	              }else if(json_data.t.marketId==3){
	            	  category="国际贸易最新政策";
	              }
	              $("#category p").append(category);
	              disp=(json_data.t.recommend==1)?"是":"否";
	              $("#disp p").append(disp);
	              $("#publish p").append(json_data.t.newsdate);
	              $("#writer p").append(json_data.t.writer);
	             console.log('<img src="'+json_data.t.msgpic+'/"  width="260px" height="160px">')
	              $("#msgpic p").append('<img src="'+json_data.t.newPicUrl+'"  width="260px" height="160px">');
	              $("#intro p").append(json_data.t.newsSummary);
	              $("#content p").append(json_data.t.newContent);
	            }
	        });    	
	    });
	   </script>     
    </head>    
    <body>
     <div class="wrap">
	        <div class="x-nav">
	            <div class="title">
	              <a><cite>新闻资讯管理 >> 新闻详情</cite></a>                
	              <a href="page/news" class="back">返回上页</a>
	            </div>          
	        </div>
	        <div class="x-body">
	        	<form action="" class="fom" method="POST"  enctype="multipart/form-data">
	                <table class="detatable infotable">
	                  <tr>
		                  <td width="20%"><label>新闻标题：</label></td>
		                  <td id="title" width="80%"><p></p></td>
	                  </tr>      
	                  <tr>
	                       <td><label>新闻所属栏目：</label></td>
	                       <td id="category"><p></p></td>
	                  </tr>                
	                  <tr>
	                  		<td><label>是否推荐：</label></td>
	                  		<td id="disp"><p></p></td>
	                  </tr>
	                  <tr>
	                  		<td ><label>发布时间：</label></td>
	                        <td id="publish"><p></p></td>
	                  </tr>
	                   <tr>
	                  		<td ><label>前台登录名：</label></td>
	                        <td id="writer"><p></p></td>
	                  </tr>
	                  <tr>
	                        <td><label>新闻主图：</label></td>
	                        <td id="msgpic"><p></p></td>
	                  </tr>   
	                  <tr>
	                  		<td><label>新闻摘要：</label></td>
	                  		<td id="intro"><p></p></td>
	                  </tr>
	                  <tr>
	                  		<td><label>详细内容：</label></td>
	                  		<td id="content"><p></p></td>
	                  </tr>
	                 </table>
	            </form>
	        </div>
        </div>
     </body>
</html>